package app.mvp.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;


/**
 * Created by 刘智强 on 2016/11/2.
 */

public class NetWorkUtil {
    private static String result;
    /**
     *
     * 方法说明：判断是否开启网络
     *
     * @param mContext
     * @return
     */
    public static boolean isNetwork(Context mContext){
        ConnectivityManager manager=(ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo info=manager.getActiveNetworkInfo();
        if(info==null||!info.isAvailable()){
            return false;
        }
        return true;
    }


}
